using Legacy.Core.SaveGameManagement;

namespace MMXSaveGameConverter
{
    internal static class SaveGameExm
    {
        public static SaveGameMeta GetMeta(this SaveGame self)
        {
            return self.GetPrivateFieldValue<SaveGameMeta>("m_metaData");
        }

        public static void SetMeta(this SaveGame self, SaveGameMeta meta)
        {
            self.SetPrivateFieldValue("m_metaData", meta);
        }

        public static void SetName(this SaveGame self, string name)
        {
            SaveGameMeta meta = self.GetPrivateFieldValue<SaveGameMeta>("m_metaData");
            meta.Name = name;
            self.SetPrivateFieldValue("m_metaData", meta);
        }
    }
}